clc;
close all;

%image
image = imread('mandrill_lumi.bmp');

%filter
gaussianFilter = (1/331)*[1,4,7,4,1;4,20,33,20,4;7,33,55,33,7;4,20,33,20,4;1,4,7,4,1];
sharpFilter = fspecial('unsharp');
edgeFilter = [-1,-1,-1;-1,8,-1;-1,-1,-1];

%filtered image
gaussianFilteredImage = imfilter(image, gaussianFilter);
sharpFilteredImage = imfilter(gaussianFilteredImage, sharpFilter);
edgeFilteredImage = imfilter(gaussianFilteredImage, edgeFilter);

sharpenedImage = gaussianFilteredImage + edgeFilteredImage;

subplot(2,3,1);
imshow(image);
title('Originale');

subplot(2,3,2);
imshow(gaussianFilteredImage);
title('Avec filtre passe bas');

subplot(2,3,3);
imshow(edgeFilteredImage);
title('Avec filtre Laplacien');

subplot(2,3,4);
imshow(sharpenedImage);
title('Addition des images filtrees');

subplot(2,3,5);
imshow(sharpFilteredImage);
title('Utilisation de la fonction fspecial');